package com.tsc.dateinfo;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Calendar;

public class ServerLog {
	public static final String LOG_PATH = "./log.txt";
	public static void log(String tag, String text) {
		FileWriter fw = null;
		try {
			fw = new FileWriter(LOG_PATH,true);
			Calendar cal = Calendar.getInstance();
			fw.append(cal.getTime().toString() + " : \t" + tag + " : " + text + "\r\n");
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		try {
			fw.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
